import request from '@/config/axios'

export interface MemberFeeVO {
  id: number
  memId: number
  inyear: number
  amount: number
  ctime: number
  mark: string | undefined
  mobile: string | undefined
  nickname: string | undefined
  groupName: string | undefined
  tagName: string | undefined | null
}

export interface MemberFeeStatisticVo {
  id: number
  memId: number
  inyear: number
  feeDate: string | undefined
  amount: number
  sumAmount: number
  mobile: string | undefined
  nickname: string | undefined
  groupName: string | undefined
  tagName: string | undefined | null
}

export interface MemberFeeConfigVo {
  id: number
  inyear: number
  tagId: number
  amount: number
  ctime: number
  remark: string | undefined
}

export const getMemberFee = async (id: number) => {
  return await request.get({ url: `/chamber/fee/get?id=` + id })
}
// 查询会员交费列表
export const getMemberFeePage = async (params) => {
  return await request.get({ url: `/chamber/fee/page`, params })
}
export const updateMemberFee = async (data: MemberFeeVO) => {
  return await request.post({ url: `/chamber/fee`, data })
}
export const deleteMemberFee = async (id: number) => {
  return await request.delete({ url: `/chamber/fee?id=` + id })
}
export const getMemberFeeStatistic = async (params) => {
  return await request.get({ url: `/chamber/fee/statistic`, params })
}

export const getMemberFeeConfig = async (id: number) => {
  return await request.get({ url: `/chamber/fee/config/get?id=` + id })
}
// 
export const getMemberFeeConfigList = async (params) => {
  return await request.get({ url: `/chamber/fee/config/list`, params })
}
// 
export const initMemberFeeConfig = async () => {
  return await request.get({ url: `/chamber/fee/config/init`} )
}
// 
export const updateMemberFeeConfig = async (data: MemberFeeConfigVo) => {
  return await request.post({ url: `/chamber/fee/config`, data })
}
// 
export const deleteMemberFeeConfig = async (id: number) => {
  return await request.delete({ url: `/chamber/fee/config?id=` + id })
}

// 查询会员用户详情
export const getMemberList = async (groupId: number) => {
  return await request.get({ url: `/chamber/fee/queryMemberList?groupId=` + groupId })
}

// 查询会员生日
export const getMemberBirthdayList = async (params) => {
  return await request.get({ url: `/chamber/birthday`, params })
}


export const getMemberPointBizTypeList = async () => {
  return await request.get({ url: `/chamber/point/bizType` })
}
export const getMemberPoint = async (id: number) => {
  return await request.get({ url: `/chamber/point?id=` + id })
}
export const getMemberPointPage = async (params) => {
  return await request.get({ url: `/chamber/point/page`, params })
}
export const publishMemberPoint = async (data: MemberFeeVO) => {
  return await request.post({ url: `/chamber/point/publish`, data })
}
export const handleMemberPoint = async (data: MemberFeeVO) => {
  return await request.put({ url: `/chamber/point`, data })
}
export const deleteMemberPoint = async (id: number) => {
  return await request.delete({ url: `/chamber/point?id=` + id })
}
export const getMemberPointStatistic = async () => {
  return await request.get({ url: `/chamber/point/statistic` })
}
